package com.g3d.types;

public class G3DVector3 implements Comparable<G3DVector3> 
{

	public G3DVector3()
	{
		this.x = 0.0f;
		this.y = 0.0f;
		this.z = 0.0f;
	}
	
	public G3DVector3(float x, float y, float z)
	{
		this.x = x;
		this.y = y;
		this.z = z;
	}

	public G3DVector3 clone()
	{
		return new G3DVector3(this.x, this.y, this.z);
	}
	
	public float x;
	public float y;
	public float z;
	
	@Override
	public int compareTo(G3DVector3 another) 
	{
		if(this.x == another.x && this.y == another.y && this.z == another.z)
			return 0;
		else
			return 1;
	}
	
	public float[] vectorArray()
	{
		float[] vector = new float[3];
		vector[0] = this.x;
		vector[1] = this.y;
		vector[2] = this.z;
		return vector;
	}

	public float[] vectorArray(float w)
	{
		float[] vector = new float[4];
		vector[0] = this.x;
		vector[1] = this.y;
		vector[2] = this.z;
		vector[3] = w;
		return vector;
	}
	
}
